<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("contextPath", request.getContextPath());
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<base href="<%=basePath%>">

<title>Book list page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">


<style>
.header{
	width: 100%;
	margin-top: 0;
	margin-bottom: 0;
}
.container
{
position:absolute;
left:100px;
top:50px;
width:750px;
}

</style>
</head>
</html>

<body>
<a href="adminHome">首页</a><a href="book/findBooks">继续查找</a>
	<div class=container>
		<table border="1" >
			<tr>
				<td>书名</td>
				<td>作者</td>
				<td>出版社</td>
				<td>售价</td>
				<td>销量</td>
				<td>库存</td>
				<td>上下架</td>
				<td>编辑</td>
			
			</tr>
			<c:forEach items="${books}" var="b">
				<tr>
					<td>${b.name}</td>
					<td>${b.author}</td>
					<td>${b.press }</td>
					<td>${b.outPrice }</td>
					<td>${b.saleVolume }</td>
					<td>${b.storageVolume }</td>
					<td><a href="book/modifyOnSale?onSale=${b.onsaleFlag}&id=${b.id}"><c:if test="${b.onsaleFlag==true}">下架</c:if><c:if test="${b.onsaleFlag!=true}">上架</c:if></a></td>
					<td><a href="book/modifyBook?id=${b.id}">编辑</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>